package com.sample.mapping;

import javax.persistence.Column;


public class Picture<T> extends AbstractMapping<T> {

	@Column(name="post_id")
	private T postId;
	
	@Column(name="user_id")
	private T userId;
	
	@Column(name="picture_name")
	private String pictureName;
	
	@Column(name="url_loc")
	private String urlLocation;

	public T getPostId() {
		return postId;
	}

	public void setPostId(T postId) {
		this.postId = postId;
	}

	public T getUserId() {
		return userId;
	}

	public void setUserId(T userId) {
		this.userId = userId;
	}

	public String getPictureName() {
		return pictureName;
	}

	public void setPictureName(String pictureName) {
		this.pictureName = pictureName;
	}

	public String getUrlLocation() {
		return urlLocation;
	}

	public void setUrlLocation(String urlLocation) {
		this.urlLocation = urlLocation;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((pictureName == null) ? 0 : pictureName.hashCode());
		result = prime * result + ((postId == null) ? 0 : postId.hashCode());
		result = prime * result
				+ ((urlLocation == null) ? 0 : urlLocation.hashCode());
		result = prime * result + ((userId == null) ? 0 : userId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Picture other = (Picture) obj;
		if (pictureName == null) {
			if (other.pictureName != null)
				return false;
		} else if (!pictureName.equals(other.pictureName))
			return false;
		if (postId == null) {
			if (other.postId != null)
				return false;
		} else if (!postId.equals(other.postId))
			return false;
		if (urlLocation == null) {
			if (other.urlLocation != null)
				return false;
		} else if (!urlLocation.equals(other.urlLocation))
			return false;
		if (userId == null) {
			if (other.userId != null)
				return false;
		} else if (!userId.equals(other.userId))
			return false;
		return true;
	}
	
	
}
